package com.webchat.pgc.controller.mall;


import com.webchat.common.bean.APIPageResponseBean;
import com.webchat.common.bean.APIResponseBean;
import com.webchat.common.bean.APIResponseBeanUtil;
import com.webchat.domain.vo.request.mall.ShopReviewRequestVO;
import com.webchat.domain.vo.response.mall.MallShopReviewResponseVO;
import com.webchat.pgc.service.mall.MallShopReviewService;
import com.webchat.rmi.pgc.mall.MallShopReviewClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MallShopReviewController implements MallShopReviewClient {


    @Autowired
    private MallShopReviewService mallShopReviewService;

    @Override
    public APIPageResponseBean<MallShopReviewResponseVO> page(String shopName, Integer reviewStatus,
                                                              Integer pageNo, Integer pageSize) {
        return mallShopReviewService.page(shopName, reviewStatus, pageNo, pageSize);
    }

    @Override
    public APIResponseBean<Boolean> review(@RequestBody ShopReviewRequestVO shopReviewRequestVO) {
        boolean res = mallShopReviewService.review(shopReviewRequestVO);
        return APIResponseBeanUtil.success(res);
    }
}
